 CREATE PROCEDURE [dbo].[ClinicTypeGet]
	@Id					UNIQUEIDENTIFIER,
	@SpecialtyId		UNIQUEIDENTIFIER
AS

SELECT	CT.*
FROM	ClinicType	CT
INNER JOIN Specialty S
	ON	CT.SpecialtyId = S.Id
WHERE	
		(@Id IS NULL OR CT.Id = @Id)
	AND (@SpecialtyId IS NULL OR @SpecialtyId = CT.SpecialtyId)
					
	
RETURN @@ROWCOUNT